package com.aestheticshare.main.introduction;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.aestheticshare.main.R;

@SuppressLint("SetJavaScriptEnabled")
public class IntroductionPagerAdapter extends FragmentPagerAdapter {

	int[] INTRO_RES = new int[] {
		R.drawable.intro_0,
		R.drawable.intro_1,
		R.drawable.intro_2,
		R.drawable.intro_3
	};
	
	IntroductionFragment[] fragment = new IntroductionFragment[INTRO_RES.length];
	
	public IntroductionPagerAdapter(FragmentManager fm) {
		super(fm);
		for(int i = 0; i < INTRO_RES.length; i++){
			Bundle arg = new Bundle();
			arg.putInt("res", INTRO_RES[i]);
			fragment[i] = new IntroductionFragment_();
			fragment[i].adapter = this;
			fragment[i].setArguments(arg);
		}
	}
	
	@Override
	public Fragment getItem(int index) {
		return fragment[index];
	}

	@Override
	public int getCount() {
		return INTRO_RES.length;
	}

}
